package com.lambda.demo.models;

import java.util.Objects;

public class Book {
  //id
  private Long id;
  //name
  private String name;
  //category
  private String category;
  //score
  private int score;
  //intro
  private String intro;

  public Book(Long id, String name, String category, int score, String intro) {
    this.id = id;
    this.name = name;
    this.category = category;
    this.score = score;
    this.intro = intro;
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getCategory() {
    return category;
  }

  public void setCategory(String category) {
    this.category = category;
  }

  public int getScore() {
    return score;
  }

  public void setScore(int score) {
    this.score = score;
  }

  public String getIntro() {
    return intro;
  }

  public void setIntro(String intro) {
    this.intro = intro;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    Book book = (Book) o;
    return score == book.score && Objects.equals(id, book.id) && Objects.equals(name, book.name) && Objects.equals(category, book.category) && Objects.equals(intro, book.intro);
  }

  @Override
  public int hashCode() {
    return Objects.hash(id, name, category, score, intro);
  }
}
